# -*- coding: utf-8 -*-
from common import orm
from common.utils.types import Enum
from sqlalchemy.orm import relationship
from sqlalchemy import Table, Column, Integer, ForeignKey

class Range(orm.Model):
    __tablename__ = "range"
    id = orm.Column(orm.Integer, primary_key=True, autoincrement=True)
    range_code=orm.Column(orm.VARCHAR)
    range_from=orm.Column(orm.VARCHAR)
    range_to=orm.Column(orm.VARCHAR)
    assigned_id=orm.Column(orm.Integer,  ForeignKey('range_cards_assign.id'))
    status=orm.Column(orm.Integer, default=0)
    type=orm.Column(orm.Integer)
    updated_by=orm.Column(orm.VARCHAR)
    updated_at=orm.Column(orm.DATETIME)
    created_by=orm.Column(orm.VARCHAR)
    created_at=orm.Column(orm.DATETIME)

class RangeCardsAssign(orm.Model):
    __tablename__ = "range_cards_assign"
    id = orm.Column(orm.Integer, primary_key=True, autoincrement=True)
    cards = orm.Column(orm.VARCHAR)
    companies = orm.Column(orm.VARCHAR)
    updated_by = orm.Column(orm.VARCHAR)
    updated_at = orm.Column(orm.DATETIME)
    created_by = orm.Column(orm.VARCHAR)
    created_at = orm.Column(orm.VARCHAR)



